//package cn.gok.web;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.lang.reflect.Method;
//import java.util.HashMap;
//import java.util.Map;
//
//@WebServlet("/*")
//public class DispatcherServlet extends HttpServlet {
//    public static Map<String ,String > pathMapper=new HashMap<>();
//    @Override
//    public void init(){
//        pathMapper.put("/stu/login","cn.gok.controller.StudentController.login");
//        pathMapper.put("/stu/update","cn.gok.controller.StudentController.updateStuInfo");
//        pathMapper.put("/stu/getInfo","cn.gok.controller.StudentController.getStuInfo");
//    }
//
//    @Override
//    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        String Path = req.getServletPath();
//        String executeMethod = pathMapper.get(Path);
//        //拆除执行方 全类目 和 方法名
//        String className=executeMethod.substring(0,executeMethod.lastIndexOf("."));
//        String methodName=executeMethod.substring(executeMethod.lastIndexOf("."));
//        Class<?> aClass = null;
//        try {
////            aClass = Class.forName(className);
////            Method method = aClass.getMethod(methodName, HttpServletRequest.class, HttpServletResponse.class);
////            Object o = aClass.getConstructor().newInstance();
////            method.invoke()
//
//        } catch (ClassNotFoundException e) {
//            e.printStackTrace();
//        }
//
//
//    }
//}
